home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / dskut / disktime.zip / SEEK.PAS < prev   
Pascal/Delphi Source File  |  1985-11-02  |  906b  |  34 lines

  1. Procedure Seek(Var Drive,Cylinder:Integer);
  2. {
  3.     This procedure locates the heads on specified drive to specified cylinder
  4.  
  5.     Input        Drive    Integer specifying drive to test
  6.  
  7.                  Cylinder Integer specifying track for heads
  8.  
  9.     Output       None
  10.  
  11.     Strategy     (1)      Execute BIOS call to position heads as requested
  12.                           Fatal error if BIOS complains
  13.  
  14. }
  15. Type
  16.     Result=Record
  17.                  Ax,Bx,Cx,Dx,Bp,Si,Di,Ds,Es,Flags:Integer;
  18.     End;
  19. Var
  20.    Sys:Result;
  21. Begin
  22.      SYS.AX:=$0C*$0100+$01 { AH=0Ch means seek, AL=Sector };
  23.      SYS.CX:=Lo(Cylinder)*$0100+Hi(Cylinder)*$40+$01;
  24.      SYS.DX:=$80+Drive     { DH=head number, DL=$80+drive };
  25.      Intr($13,Sys);
  26.  
  27.      If Odd(Sys.Flags) then
  28.         Begin
  29.              Writeln('Seek Error on Cylinder ',Cylinder,', Drive ',Drive);
  30.              Halt;
  31.         End;
  32. End;
  33.  
  34.